import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:wanxiang_app/utils/constant.dart';
import '../../widgets/myappbar.dart';

class Sell2Page extends StatefulWidget {
  @override
  _HomeState createState() => _HomeState();
}
class _HomeState extends State<Sell2Page> {

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return
      Scaffold(
        backgroundColor: Colors.white,
        appBar: MyAppBar(context: context, title: '消息',),
        body: _content(),
      );
  }

  Widget _content(){
    return Container(
      child: Column(
        children: [
          Container(height: 10.h,color: Color(0xFFF5F5F5),),
          Expanded(child:   TextField(

          ))

        ],
      ),
    );
  }

  Widget _top(){
    return Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: [
        _topItem(Constant.IMG_BASE+'msg_platform_service.png','平台客服',0),
        _topItem(Constant.IMG_BASE+'msg_tousu_service.png','投诉客服',1),
        _topItem(Constant.IMG_BASE+'msg_group.png','交易群组',2),
        _topItem(Constant.IMG_BASE+'msg_notice.png','平台公告',3),
      ],
    );
  }
  int clickIndex = 0;
  Widget _topItem(img,name,index){
    return InkWell(
        onTap: (){
          setState(() {
            clickIndex = index;
            if(index== 3){

            }else{

            }
          });

        },
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Image.asset(img,width: 54.w,height: 54.h,),
            SizedBox(height: 10.h,),
            Text(name,style: TextStyle(
                color: Color(0xFF333333),
                fontSize: 12.sp
            ),),
            SizedBox(height: 11.h,),
            Container(width: 34.w,height: 2.h,color: Color(0xFFF43F50),)
          ],
        )
    ) ;
  }

  Widget _serviceItem(){
    return Container(
      margin: EdgeInsets.only(left: 22.w,right: 22.w,top: 19.h),
      child:
      Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Row(
            children: [
              Container(
                width: 48.w,
                height: 48.h,
                decoration: BoxDecoration(
                    color: Colors.red,
                    borderRadius: BorderRadius.circular(24.r)
                ),
              ),
              SizedBox(width: 15.w,),
              Text('客服名称',style: TextStyle(
                  color: Color(0xFF333333),
                  fontSize: 14.sp
              ),)
            ],
          ),
          Image.asset(Constant.IMG_BASE+'msg_arrow_right.png',width: 6.w,height: 11.h,)
        ],
      )
      ,
    );
  }

  Widget _noticeItem(){
    return Container(
      padding: EdgeInsets.only(left: 24.w,top: 25.h,right: 24.w),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Row(
                children: [
                  Container(
                    width: 6.w,
                    height: 6.h,
                    decoration: BoxDecoration(
                      color: Color(0xFFF43F50),
                      shape: BoxShape.circle,
                    ),
                  ),
                  Text('五一假期游戏限玩通知',style: TextStyle(
                      color: Color(0xFF333333),
                      fontSize: 14.r
                  ),)
                ],
              ),
              SizedBox(height: 7.h,),
              Container(
                  width: MediaQuery.of(context).size.width - 38.w - 48.w,
                  child:    Text('五一将近，伴随着假期的调休，发发肥肥 的火啊啊啊啊啊',style: TextStyle(
                      color: Color(0xFF333333),
                      fontSize: 14.r
                  ),maxLines: 1, overflow: TextOverflow.ellipsis)
              )


            ],
          ),
          Image.asset(Constant.IMG_BASE+'msg_arrow_right.png',width: 6.w,height: 11.h,)

        ],
      ),
    );
  }

}